Conversation
|
|
9970c76 to
e6f6aba
Compare
There was a problem hiding this comment.
Pull request overview
Adds a DevStats-oriented query layer and exposes a new public API endpoint to bulk-resolve GitHub contributor affiliations (including timeline conflict resolution) from existing member work experience and manual affiliation data.
Changes:
- Exports new DAL modules (
affiliations,devStats) from the data-access-layer package. - Adds DAL query helpers for DevStats lookups (members by GitHub handle; verified emails by memberId).
- Implements
POST /v1/dev-stats/affiliationshandler wired into the public router.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| services/libs/data-access-layer/src/index.ts | Re-exports new DAL entrypoints so downstream services can consume them. |
| services/libs/data-access-layer/src/devStats/index.ts | Adds DevStats-focused queries for bulk member lookup and verified emails. |
| services/libs/data-access-layer/src/affiliations/index.ts | Introduces bulk affiliation resolution and timeline-building logic. |
| backend/src/api/public/v1/dev-stats/index.ts | Wires the /affiliations route to the new handler with scope protection. |
| backend/src/api/public/v1/dev-stats/getAffiliations.ts | Implements request validation, DAL lookups, and response shaping for the endpoint. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
7849e93 to
da7a1a7
Compare
da7a1a7 to
fe0c5a5
Compare
6c63040 to
294f705
Compare
d713ebd to
080da1e
Compare
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
cdc78ea to
93824fe
Compare
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
There are 4 total unresolved issues (including 3 from previous reviews).
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>
Signed-off-by: Umberto Sgueglia <usgueglia@contractor.linuxfoundation.org>

DevStats Affiliations API + Generic DAL resolver
Implements the
/v1/dev-stats/affiliationsendpoint that allows external tools (e.g. DevStats/gitdm) to resolve GitHub contributor affiliations in bulk.API
Accepts up to 1,000 handles per request. Returns resolved, non-overlapping affiliation periods per contributor, sorted by most recent first.
Implementation
services/libs/data-access-layer/src/affiliations/— new generic module, usable by any consumer:IAffiliationPeriod— public type representing a single affiliation windowresolveAffiliationsByMemberIds— bulk resolver for up to N members in 2 DB queriesfindWorkExperiencesBulk/findManualAffiliationsBulk— exported separately for reuseprepareMemberOrganizationAffiliationTimelinebut uses an interval-based approach (boundary dates) instead of day-by-day iteration, making it viable for bulk requestsNote
Medium Risk
Adds a new public endpoint plus new SQL-backed bulk affiliation resolution logic, and changes public API auth/routing (OAuth vs static API key), which could affect access control and response behavior.
Overview
Adds a new DevStats affiliations API that accepts a list of GitHub handles and returns contributor emails plus resolved, non-overlapping affiliation periods with paging.
To support this, introduces new data-access-layer modules:
devStatsqueries for verified GitHub handles/emails andaffiliationsbulk-resolves affiliation timelines from work experiences + manual segment affiliations.Public API routing/auth is reworked: OAuth2 is now applied per
v1route (/members,/organizations), while the new affiliations endpoint is mounted under/v1/member-organization-affiliationsbehindstaticApiKeyMiddleware, andv1now throwsNotFoundErrorfor unknown routes. Also adds a 400 response for invalid JSON bodies and reduces public API error logs to name/message/stack fields.Written by Cursor Bugbot for commit 543c953. This will update automatically on new commits. Configure here.